﻿<%@ page contentType="text/html;charset=UTF-8" autoFlush="true"%>
<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt"%>
<%@ taglib uri="/WEB-INF/qautil.tld" prefix="qautil"%>
<jsp:include page="viewmyinfo.jsp"/>
<br>
<table align="center" width="100%" cellpadding="0" cellspacing="0" border="0">
    <tr>
        <td>   
            <span class="title1">
            	<html:link page="/user.mrqa?action=myquestions">
            		我的帖子
            	</html:link>
            </span>
            <span class="title">
            	<html:link page="/user.mrqa?action=myanswers">
            		我的回复
            	</html:link>
            </span>
            <span class="title">
            	<html:link page="/user.mrqa?action=viewmysharedfiles">
            		共享资料
            	</html:link>
            </span>
            <span class="title">
            	<html:link page="/user.mrqa?action=mylinks">
            		我的收藏
            	</html:link>
            </span>
            <span class="title">
            	<html:link page="/user.mrqa?action=myspend">
            		积分兑换
            	</html:link>
            </span>
            <span class="title">
            	<html:link page="/user.mrqa?action=myaward">
            		积分奖励
            	</html:link>
            </span>
        </td>
        <td align="right">帖子总数:<b><c:out value="${resultSize}"/></b>&nbsp;&nbsp;</td>
    </tr>
</table>    
<table align="center" class="qlist" width="100%" cellpadding="0" cellspacing="0">
    <thead>
    <tr>
        <th>分类</th>
        <th>标题</th>
        <th>日期</th>
        <th>操作</th>        
    </tr>
    </thead>
    <tbody>
    <c:forEach  var="question" items="${questions}" varStatus="index">
    <c:if test="${(index.count)%2 == 0}">
        <tr class="even">    
    </c:if>
    <c:if test="${(index.count)%2 != 0}">
        <tr class="odd">    
    </c:if>
        <td><c:out value="${question.mrIaskCategory.name}"/></td>
        <td>
        	<c:if test="${question.mrIaskCategory.type==0}">
            <html:link page="/question.mrqa?action=view" paramId="id" paramName="question" paramProperty="id">
            	<c:if test="${question.titleAttribute != null}">
            		<span style="<c:out value="${question.titleAttribute}" />">
            	</c:if>
            	<c:out value="${question.title}" escapeXml="false"/>
            	<c:if test="${question.titleAttribute != null}">
            		</span>
            	</c:if>
            </html:link>
          </c:if>
          <c:if test="${question.mrIaskCategory.type==1}">
          	<html:link page="/life.mrqa?action=view" paramId="id" paramName="question" paramProperty="id">
          		<c:if test="${question.titleAttribute != null}">
            		<span style="<c:out value="${question.titleAttribute}" />">
            	</c:if>
          		<c:out value="${question.title}" escapeXml="false"/>
          		<c:if test="${question.titleAttribute != null}">
            		</span>
            	</c:if>
          	</html:link>
        	</c:if>
        	<c:if test="${question.mrIaskCategory.type==2}">
          	<html:link page="/tech.mrqa?action=view" paramId="id" paramName="question" paramProperty="id">
          		<c:if test="${question.titleAttribute != null}">
            		<span style="<c:out value="${question.titleAttribute}" />">
            	</c:if>
          		<c:out value="${question.title}" escapeXml="false"/>
          		<c:if test="${question.titleAttribute != null}">
            		</span>
            	</c:if>
          	</html:link>
        	</c:if>
        </td>
        <td>
            <fmt:formatDate value="${question.postDate}" var="postDatexx" type="both" pattern="yyyy-MM-dd HH:mm:ss"/><c:out value="${postDatexx}"/>
        </td>
        <td>
                <%request.setAttribute("curDate",new java.util.Date());%>
                <c:set var="differ" value="${(curDate.time-question.postDate.time)/1000/60/60}"/>
                <c:if test="${differ <= 24}">
                    <html:link page="/question.mrqa?action=delete&from=mycenter" paramId="id" paramName="question" paramProperty="id">
                        删除
                    </html:link>
                </c:if>
        </td>
    </tr>
    </c:forEach>
    </tbody>
</table>
<qautil:page action="/user.mrqa"/>
